package com.jh.paymentchannel.pojo;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * 条码支付返回结果
 */
public class MicroPay {
    /**
     * 返回状态：SUCCESS成功/FAIL失败
     */
    private String return_code;
    /**
     * 支付状态 ：SUCCESS支付成功，FAIL支付失败，PAYING支付中；客户端超时未返回状态，需调用出阿薰接口查看订单状态
     */
    private String pay_status;
    /**
     * 失败说明：错误时返回，异常说明
     */
//    private String pay_msg;
    /**
     * 商户原订单号
     */
    private String orderId;
    /**
     * 快银订单号
     */
    private String out_trade_no;
    /**
     * 订单类型：weixin/alipay
     */
    private String order_type;
    /**
     * 支付成功时间：yyyyMMddHHmmss
     */
    private String timeEnd;
    /**
     * 通道流水号，退款单号
     */
    private String transaction_id;
    /**
     * 用户应付金额
     */
    private BigDecimal payable = BigDecimal.ZERO;
    /**
     * 活动优惠金额
     */
    private BigDecimal activity = BigDecimal.ZERO;
    /**
     * 用户实付金额
     */
    private BigDecimal paidout = BigDecimal.ZERO;
    /**
     * 手续费金额
     */
    private BigDecimal commission = BigDecimal.ZERO;
    /**
     * 签名
     */
    private String sign;

    public String getReturn_code() {
        return return_code;
    }

    public void setReturn_code(String return_code) {
        this.return_code = return_code;
    }

    public String getPay_status() {
        return pay_status;
    }

    public void setPay_status(String pay_status) {
        this.pay_status = pay_status;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getOrder_type() {
        return order_type;
    }

    public void setOrder_type(String order_type) {
        this.order_type = order_type;
    }

    public String getTimeEnd() {
        return timeEnd;
    }

    public void setTimeEnd(String timeEnd) {
        this.timeEnd = timeEnd;
    }

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public BigDecimal getPayable() {
        return payable;
    }

    public void setPayable(BigDecimal payable) {
        this.payable = payable;
    }

    public BigDecimal getActivity() {
        return activity;
    }

    public void setActivity(BigDecimal activity) {
        this.activity = activity;
    }

    public BigDecimal getPaidout() {
        return paidout;
    }

    public void setPaidout(BigDecimal paidout) {
        this.paidout = paidout;
    }

    public BigDecimal getCommission() {
        return commission;
    }

    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof MicroPay)) return false;
        MicroPay microPay = (MicroPay) o;
        return Objects.equals(getReturn_code(), microPay.getReturn_code()) &&
                Objects.equals(getPay_status(), microPay.getPay_status()) &&
                Objects.equals(getOrderId(), microPay.getOrderId()) &&
                Objects.equals(getOut_trade_no(), microPay.getOut_trade_no()) &&
                Objects.equals(getOrder_type(), microPay.getOrder_type()) &&
                Objects.equals(getTimeEnd(), microPay.getTimeEnd()) &&
                Objects.equals(getTransaction_id(), microPay.getTransaction_id()) &&
                Objects.equals(getPayable(), microPay.getPayable()) &&
                Objects.equals(getActivity(), microPay.getActivity()) &&
                Objects.equals(getPaidout(), microPay.getPaidout()) &&
                Objects.equals(getCommission(), microPay.getCommission()) &&
                Objects.equals(getSign(), microPay.getSign());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getReturn_code(), getPay_status(), getOrderId(), getOut_trade_no(), getOrder_type(), getTimeEnd(), getTransaction_id(), getPayable(), getActivity(), getPaidout(), getCommission(), getSign());
    }

    @Override
    public String toString() {
        return "MicroPay{" +
                "return_code='" + return_code + '\'' +
                ", pay_status='" + pay_status + '\'' +
                ", orderId='" + orderId + '\'' +
                ", out_trade_no='" + out_trade_no + '\'' +
                ", order_type='" + order_type + '\'' +
                ", timeEnd='" + timeEnd + '\'' +
                ", transaction_id='" + transaction_id + '\'' +
                ", payable=" + payable +
                ", activity=" + activity +
                ", paidout=" + paidout +
                ", commission=" + commission +
                ", sign='" + sign + '\'' +
                '}';
    }
}
